package com.naiterui.ehp.bs.ds.modules.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bs.ds.common.utils.PageVO;
import com.naiterui.ehp.bs.ds.common.vo.PageParamsVO;
import com.naiterui.ehp.bs.ds.modules.sys.entity.Log;
import com.naiterui.ehp.bs.ds.modules.sys.service.ILogService;

import io.swagger.annotations.Api;

/**
 * 系统日志
 */
@Validated
@Api(tags = {SwaggerTag.DS + SwaggerTag.SYS})
@RestController
@RequestMapping("/sys/log")
public class LogController {

  @Autowired
  private ILogService logService;

  /**
   * 列表
   *
   * @return
   */
  @GetMapping("/list")
  @PreAuthorize("@p.check('sys:log:list')")
  public PageVO<Log> list(PageParamsVO pageParamsVO, Log log) {
    return this.logService.queryPage(pageParamsVO, log);
  }

}
